﻿
using HBase;
using hCommand; 
using System;
using System.Collections.Generic;
namespace Persistence {
    public class TaskRobot :BaseTask {
        public static int getBaseDistance(Edge e) {
            return e.b;
        }
        public List<long> r;
        public int robotId {
            get; set;
        }
        public TaskRobot() { }
        public int srcHeight {
            get; set;
        }
        public int desHeight {
            get; set;
        }
        public int spec {//规格类型
            get; set;
        }
        public int itemType {//0， 空托盘，1正常托盘
            get; set;
        }
        public override List<string> getLableData() {
            List<String> list = new List<string>();
            list.Add(extra);
            list.Add("起点：" + src);
            list.Add("终点：" + des);
            return list;
        }


        public override int getDes() {
            return 5009 - des;
        }
        public override int getSrc() {
            return 5009 - src;
        }
         public override void init(CoreTask complete, CoreTaskParam param, TaskDto taskDto,List<TaskDto> keyList) {
         
            
            status = (( short ) param.status == 0) ? ( short ) 1 : ( short ) param.status;
            if( status == (int)CoreTaskParamStatus.执行结束 && param.cStn != param.des ) {
                status = (int)CoreTaskParamStatus.待执行;
            }
     
            
            if( src > 5000 && src < 5009 ) {
                driveId = 1;
                src = 5009 - src;
                des = 5009 - des;
            }
            

            extra = string.Format("机器人：{0},{1}-->{2},{3}" ,src ,srcHeight ,des ,desHeight);
        }
    }
}
